package cn.iocoder.yudao.module.project.dal.mysql.dispatchlist;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.project.dal.dataobject.dispatchlist.DispatchListDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.project.controller.admin.dispatchlist.vo.*;

/**
 * 派工单 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface DispatchListMapper extends BaseMapperX<DispatchListDO> {

    default PageResult<DispatchListDO> selectPage(DispatchListPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DispatchListDO>()
                .betweenIfPresent(DispatchListDO::getShipmentDate, reqVO.getShipmentDate())
                .eqIfPresent(DispatchListDO::getCustomer, reqVO.getCustomer())
                .eqIfPresent(DispatchListDO::getTicketNumber, reqVO.getTicketNumber())
                .eqIfPresent(DispatchListDO::getInternalNumber, reqVO.getInternalNumber())
                .eqIfPresent(DispatchListDO::getModelKp, reqVO.getModelKp())
                .eqIfPresent(DispatchListDO::getFlex, reqVO.getFlex())
                .eqIfPresent(DispatchListDO::getHammerPlateStructure, reqVO.getHammerPlateStructure())
                .eqIfPresent(DispatchListDO::getHammerPlateModel, reqVO.getHammerPlateModel())
                .eqIfPresent(DispatchListDO::getDirection, reqVO.getDirection())
                .eqIfPresent(DispatchListDO::getQuantity, reqVO.getQuantity())
                .eqIfPresent(DispatchListDO::getProductLength, reqVO.getProductLength())
                .eqIfPresent(DispatchListDO::getTcf, reqVO.getTcf())
                .eqIfPresent(DispatchListDO::getSt1271, reqVO.getSt1271())
                .eqIfPresent(DispatchListDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(DispatchListDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DispatchListDO::getId));
    }

}